Anatomy of a function

Anatomy of a Function Definition

Labels the "function" keyword, return value,      name, parameters, comments, etc. of a function definition.

Required Form of a Function Definition

All functions must have each of the following elements:

  1. the keyword function
  2. a variable name for storing the return value
  3. an equal sign
  4. the name of the function
  5. an open parenthesis
  6. an argument list (multiple inputs are separated by commas)
  7. a close parenthesis
  8. some comments (recommended)
  9. a return value calculation

This lesson has no examples or exercises, please continue with the next lesson.